<!--
 * @Author: lirl
 * @Date: 2023-04-07 18:16:54
 * @Description: 表单样例-公文
-->
<script>
import { CommonBusinessForm } from 'jdf-common-biz';
import { mainSend } from '@/api/utils/constants';
import { unitsSecrets } from '@/utils/enum';
import GswjService from '@/api/domains/gswj/service/GswjService';
import {
  attachment,
  contract,
  contractPhone,
  copySend,
  createTime,
  empty,
  memo,
  principal,
  secret,
  serialNumber,
  title,
  units,
  urgencys,
  countersign,
} from '../form-field-constants';

export default {
  extends: CommonBusinessForm,
  data() {
    return {
      // 后台服务
      service: new GswjService(),
      isGateWayData: true,
      readonlyFields: [],
      formConfigs: [
        [units(unitsSecrets), principal, createTime],
        [serialNumber, secret, urgencys],
        [
          contract,
          contractPhone,
          empty(8)
        ],
        [title],
        [mainSend],
        [copySend],
        [countersign('countersign')],
        [attachment],
        [memo],
      ],
      validateDocNumberRequired: false,
    };
  },
  methods: {
    initBiz() {
      this.$emit('update:documentFormTitle', '中移信息技术有限公司发文稿纸');
    }
  },
  watch: {
    'formData.title': {
      handler(val) {
        this.$emit('update:processTitle', `[${this.formData.department}]${val || ''}`);
      }
    },
  }
};
</script>
